<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.ahp.bean.Factor"%>
<%@ include file="../include/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>一级因子权重</title>
<script type="text/javascript" src="<%=path %>/js/jquery-1.3.2.js"></script>
<link rel="stylesheet" href="<%=path%>/style/style_manage.css" type="text/css"></link>
<style type="text/css">

</style>
<script type="text/javascript">
next = function(){
	var mark = true;
	var sum = 0;
	$(".factor").css({"color":"black"});
	$(".factor").each(function(){
		try{
			sum += Number($(this).val());
		} catch(e){
			$(this).css({"color":"red"});
			mark = false;
			$("#result").text("所填写权重异常");
		}
	});
	if(sum == 100){
		$("#oneForm").submit();
	}else{
		$("#result").text("所填写权重和值不为100");
	}
}
</script>
</head>
<body>
<div id="management">
	<h1 style="position: relative;">一级因子权重</h1>
	<div id="result" style="color:red;"></div>
	<%
	List<Factor> oneList = null;
	if(request.getAttribute("levOneList")!=null){
		oneList = (List<Factor>)request.getAttribute("levOneList");
	}
	%><form action="<%=path %>/mod/levelOne.action" method="post" id="oneForm"><div style="text-align: center;"><%
	for(Factor factor : oneList){
	%><div style="margin: 8px auto;"><%=factor.getName() %>:<input type="text" name="id-<%=factor.getFacId() %>" value="" class="factor" /></div><%
	}
	%><input type="button" value="下一步" onclick="next();" />
		</div>
	</form>
</div>
</body>
</html>